package com.jinghao.tws.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jinghao.core.common.controller.JingHaoBaseController;
import com.jinghao.tws.entity.WvAccessConfig;
import com.jinghao.tws.service.IWvAccessConfigService;

@Controller
@Scope("prototype")
@RequestMapping(value = "/app/tws/WvAccessConfig")
public class WvAccessConfigController extends JingHaoBaseController<WvAccessConfig> {
	//==================定制内容开始======================
//在这里修改代码
	/**
	 * 查询所有连接配置信息
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/getWvAccessConfig",method = RequestMethod.GET) 
	public Map<String, Object> getWvAccessConfig(@ModelAttribute("model") WvAccessConfig model){
		this.getWvAccessConfigService().getWvAccessConfig(model);
        return model.getSingleJson();   
	} 
	
	/**
	 * 增加连接配置信息
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/addWvAccessConfig",method = RequestMethod.POST) 
	public Map<String, Object> addWvAccessConfig(@ModelAttribute("model") WvAccessConfig model,@RequestBody Map<String,Object> map){
		model.setObjMap(map);
		this.getWvAccessConfigService().addWvAccessConfig(model);
        return model.getJson();   
	} 
	
	//==================定制内容结束======================

	@Autowired
	public void setWvAccessConfigService(IWvAccessConfigService wvAccessConfigService) {
		super.setIJingHaoBaseService(wvAccessConfigService);
	}

	public IWvAccessConfigService getWvAccessConfigService() {
		return (IWvAccessConfigService) super.getIJingHaoBaseService();
	}
}
